package com.cicigodd.brick.plug.common.enums;

import lombok.Getter;

/**
 * 用户类型
 *
 * @author cicigodd
 * @date 2022/09/23 08:42:00
 */
@Getter
public enum UserEnum {


    SYSTEM(1, "系统用户"),
    MINI(2, "小程序用户"),
    MAP(2, "公众号用户"),
    ORTHER(2, "其他用户");

    private final Integer code;

    private final String message;

    UserEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    /**
     * 根据code获取枚举
     *
     * @author cicigodd
     * @date 2020/10/29 18:59
     */
    public static UserEnum codeToEnum(Integer code) {
        if (null != code) {
            for (UserEnum e : UserEnum.values()) {
                if (e.getCode().equals(code)) {
                    return e;
                }
            }
        }
        return null;
    }

}
